﻿@model IQueryable<Orion.Models.User>

@{
    ViewBag.Title = "IRIS - Innranet - Sýna alla notendur";
    Layout = "~/Views/Shared/_WorkLayout.cshtml";
}

<section id="main_content">
<h1>Sýna alla Notendur</h1>

@foreach (var m in Model)
{
    <fieldset>
        <legend>@m.FirstName @m.MiddleName @m.LastName </legend>
        @foreach(var rname in Roles.GetRolesForUser())
        {
            if( Roles.IsUserInRole(m.aspnet_User.UserName, "Admin" ) )
            {
            <p>Réttindi: Admin</p>
            }
            else if( Roles.IsUserInRole(m.aspnet_User.UserName, "Staff" ) ) 
            {
            <p>Réttindi: Staff;</p>
            }
            else if (Roles.IsUserInRole(m.aspnet_User.UserName, "General") ) 
            {
            <p>Réttindi: General;</p>
            }
                       
        }
      
        @if(@m.Valid == true)
        {
            <p>Staða: Virkur</p>
        }
        else
        {
            <p>Staða: Óvirkur</p>
        }
        @Html.ActionLink("Breyta", "Edit/" + @m.ID, "Account")
    </fieldset>  
}
</section>